import java.io.File;
import java.util.Map;

import paskal.audio.player.Controller;
import paskal.audio.player.Player;
import paskal.audio.player.PlayerEvent;
import paskal.audio.player.PlayerException;
import paskal.audio.player.PlayerListener;

public class Test implements PlayerListener {

	public Test() {
		Player player = new Player();
		player.addPlayerListener(this);
		Controller controller = (Controller) player;
		try {
			controller
					.open(new File(
							"/home/paskal/Завантаження/HIM - Rip Out The Wings Of A Butterfly.mp3"));
			controller.play();
		} catch (PlayerException e) {
			e.printStackTrace();
		}

		try {
			Thread.sleep(3000);
			// controller.setPositionInPercent(0.5);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}// } catch (PlayerException e) {
			// e.printStackTrace();
		// }
	}

	public static void main(String[] args) {
		new Test();
	}

	@Override
	public void onOpened(Object stream, Map<String, Object> properties) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onRunning(double position, Map<String, Object> properties) {
		// System.out.println(position * 100);
	}

	@Override
	public void onStateUpdated(PlayerEvent event) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onLoading(double percentage) {
		// TODO Auto-generated method stub

	}
}
